Ext.define('SKJF.view.MASTER.v_mstcurefektif_form', {
	extend	: 'Ext.form.Panel',
	
	alias	: 'widget.v_mstcurefektif_form',
	
	//region:'east',
	//id: 'east-region-container',
	
	title		: 'Create/Update mstcurefektif',
    bodyPadding	: 5,
    autoScroll	: true,
    
    initComponent: function(){
    	/*
		 * Deklarasi variable setiap field
		 */
		
		var currency_store = Ext.create('SKJF.store.s_mstcurrency',{autoLoad:true});
		
		var TGL_KURS_field = Ext.create('Ext.ux.form.DateTimeField', {
			itemId: 'TGL_KURS_field',
			name: 'TGL_KURS', /* column name of table */
			fieldLabel: 'TGL_KURS',
			format: 'Y-m-d',
			allowBlank: false /* jika primary_key */
		});
		var MATA_UANG_field = Ext.create('Ext.form.field.ComboBox', {
			itemId: 'MATA_UANG_field',
			name: 'MATA_UANG', /* column name of table */
			fieldLabel: 'MATA_UANG',
			pageSize: 10,
			typeAhead    : true,
			triggerAction: 'all',
			selectOnFocus: true,
            loadingText  : 'Searching...',
			store: currency_store,
			queryMode: 'local',
			tpl: Ext.create('Ext.XTemplate',
				'<tpl for=".">',
					'<div class="x-boundlist-item">{CURRENCY} - {NEGARA}</div>',
				'</tpl>'
			),
			displayTpl: Ext.create('Ext.XTemplate',
				'<tpl for=".">',
					'{CURRENCY} - {NEGARA}',
				'</tpl>'
			),
			valueField: 'CURRENCY',
			displayField: 'CURRENCY'
		});
		var NOMINAL_field = Ext.create('Ext.form.field.Number', {
			name: 'NOMINAL', /* column name of table */
			fieldLabel: 'NOMINAL',
			maxLength: 11 /* length of column name */
		});
		var KETERANGAN_field = Ext.create('Ext.form.field.Text', {
			name: 'KETERANGAN', /* column name of table */
			fieldLabel: 'KETERANGAN',
			maxLength: 50 /* length of column name */
		});		
        Ext.apply(this, {
            fieldDefaults: {
                labelAlign: 'right',
                labelWidth: 120,
                msgTarget: 'qtip',
				anchor: '100%'
            },
			defaultType: 'textfield',
            items: [TGL_KURS_field,MATA_UANG_field,NOMINAL_field,KETERANGAN_field],
			
	        buttons: [{
                iconCls: 'icon-save',
                itemId: 'save',
                text: 'Save',
                disabled: true,
                action: 'save'
            }, {
                iconCls: 'icon-add',
				itemId: 'create',
                text: 'Create',
                action: 'create'
            }, {
                iconCls: 'icon-reset',
                text: 'Cancel',
                action: 'cancel'
            }]
        });
        
        this.callParent();
    }
});